#ifndef X_8_H
#define X_8_H

#include "common.h"

template <AllegroVersion version>
struct x08
{
    uint32_t t;
    uint32_t k;
    
    // x08?
    
    // String
    // Note: String pointers swap position around `ptr2` in different versions.
    uint32_t str_ptr_16x;
    
    // x06
    uint32_t ptr2;
    
    // String
    
    // x11
    uint32_t ptr3;
    
    
    // Can be string, usually null
    uint32_t ptr4;
    
    uint32_t TAIL;
    operator x08<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus >= 202002L
template <AllegroVersion version> requires(version >= A_172)
struct x08<version>
{
    uint32_t t;
    uint32_t k;

    // x08?
    uint32_t ptr1;

    // String
    // Note: String pointers swap position around `ptr2` in different versions.

    // x06
    uint32_t ptr2;

    // String
    uint32_t str_ptr;

    // x11
    uint32_t ptr3;

    uint32_t un1;

    // Can be string, usually null
    uint32_t ptr4;

    uint32_t TAIL;
    operator x08<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
#else
template <> struct x08<A_172>
{
    uint32_t t;
    uint32_t k;

    // x08?
    uint32_t ptr1;

    // String
    // Note: String pointers swap position around `ptr2` in different versions.

    // x06
    uint32_t ptr2;

    // String
    uint32_t str_ptr;

    // x11
    uint32_t ptr3;

    uint32_t un1;

    // Can be string, usually null
    uint32_t ptr4;

    uint32_t TAIL;
    operator x08<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x08<A_174> : x08<A_172> {};
#endif

#endif // X_8_H
